<script setup>
import { ref, onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted } from 'vue'
const title = ref('测试生命周期')


onBeforeMount(() => {
    console.log("挂载之前....");
})
onMounted(() => {
    console.log("挂载之后...");
})

onBeforeUpdate(() => {
    console.log("更新之前");
})

onUpdated(() => {
    console.log("更新之后");
})

onBeforeUnmount(() => {
    console.log("销毁前");
})
onUnmounted(() => {
    console.log("销毁后");
})

setInterval(() => {
    title.value += "1"
}, 3000);



</script>

<template>
    <h1>{{ title }}</h1>
</template>